<?php $this->load->view('admin/adheadtitatoggle.html'); ?>
<?php $this->load->view('admin/adsider.html'); ?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Main content -->
    <section class="content">

      <div class="row">
        <div class="col-md-6">
          <div class="box box-primary">
            <div class="box-header">
              <h3 class="box-title">网站设置
                <small>&nbsp;&nbsp;网站基础设置</small>
              </h3>
            </div>
            <!-- /.box-header -->
			<form class="form-horizontal" action="<?php echo site_url('admin/setsysinfo'); ?>" method="post">
			  
			<div class="box-body">
				<div class="form-group">
                  <label for="weburl" class="col-sm-2 control-label">站点根网址</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="weburl" id="weburl" placeholder="http://example.com/" value="<?php echo isset($info->web)?$info->web:''; ?>">
                  </div>
                </div>

				<div class="form-group">
                  <label for="inputtitle" class="col-sm-2 control-label">网站名称</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="title" id="inputtitle" placeholder="title" value="<?php echo isset($info->title)?$info->title:''; ?>">
                  </div>
                </div>

				<div class="form-group">
                  <label for="keywords" class="col-sm-2 control-label">关键字</label>

                  <div class="col-sm-10">
                    <input type="text" name="keywords" class="form-control" id="keywords" placeholder="keywords 每个用','逗号隔开" value="<?php echo isset($info->keywords)?$info->keywords:''; ?>">
                  </div>
                </div>

				<div class="form-group">
                  <label for="description" class="col-sm-2 control-label">网站描述</label>

                  <div class="col-sm-10">
					<textarea class="form-control" name="description" rows="3" placeholder="description ..."><?php echo isset($info->description)?$info->description:''; ?></textarea>
                  </div>
                </div>

				<div class="form-group">
                  <label for="copyright" class="col-sm-2 control-label">版权信息</label>

                  <div class="col-sm-10">
                    <input type="text" name="copyright" class="form-control" id="copyright" placeholder="Copyright © 2016 Company. All rights reserved." value="<?php echo isset($info->copyright)?$info->copyright:''; ?>">
                  </div>
                </div>
				
				<div class="form-group">
                  <label for="icpid" class="col-sm-2 control-label">备案号</label>

                  <div class="col-sm-10">
                    <input type="text" name="icpid" class="form-control" id="icpid" placeholder="icp备案号" value="<?php echo isset($info->icp)?$info->icp:''; ?>">
                  </div>
                </div>

			<div class="box-footer">
                <button type="reset" class="btn btn-default">重置</button>
                <button type="submit" class="btn btn-info pull-right">确定</button>
              </div>

			</div>

			</form>
          </div>
          <!-- /.box -->

        </div>
        <!-- /.col  left over-->
		<div class="col-md-6">
			<div class="box box-primary">
				<div class="box-header">
				  <h3 class="box-title">网站设置
					<small>&nbsp;&nbsp;功能开关</small>
				  </h3>
				</div>
				<div class="box-body">
				<form method="post" id="switchbox" action="<?php echo site_url('admin/setonoff'); ?>">
				<!---------table--------->
				<table class="table table-bordered">
                <tbody><tr>
                  <th style="width: 5%">#</th>
                  <th>功能说明</th>
				  <th style="width: 15%">当前状态</th>
                  <th style="width: 15%">开启/关闭</th>
                </tr>
                <tr>
                  <td>1.</td>
                  <td>文件上传</td>
				  <td id="switch1"><?php echo $info->switch1?'开':'关'; ?></td>
                  <td>
                    <div class="checkbox checkbox-slider--b-flat checkbox-slider-md">
								<label>
									<input type="checkbox" name="switch1" <?php echo $info->switch1?'checked':''; ?>><span></span>
								</label>
							</div>
                  </td>
                </tr>

				<tr>
                  <td>2.</td>
                  <td>图片上传</td>
				  <td id="switch2"><?php echo $info->switch2?'开':'关'; ?></td>
                  <td>
                    <div class="checkbox checkbox-slider--b-flat checkbox-slider-md">
								<label>
									<input type="checkbox" name="switch2" <?php echo $info->switch2?'checked':''; ?>><span></span>
								</label>
							</div>
                  </td>
                </tr>

				<tr>
                  <td>3.</td>
                  <td>文章评论</td>
				  <td id="switch3"><?php echo $info->switch3?'开':'关'; ?></td>
                  <td>
                    <div class="checkbox checkbox-slider--b-flat checkbox-slider-md">
								<label>
									<input type="checkbox" name="switch3" <?php echo $info->switch3?'checked':''; ?>><span></span>
								</label>
							</div>
                  </td>
                </tr>

				<tr>
                  <td>4.</td>
                  <td>文章点赞</td>
				  <td id="switch4"><?php echo $info->switch4?'开':'关'; ?></td>
                  <td>
                    <div class="checkbox checkbox-slider--b-flat checkbox-slider-md">
								<label>
									<input type="checkbox" name="switch4" <?php echo $info->switch4?'checked':''; ?>><span></span>
								</label>
							</div>
                  </td>
                </tr>

              </tbody></table>
					
				</form>
				</div>
				
			</div>
		</div>
      </div>
      <!-- ./row -->
<style type="text/css">
<!--
.table tbody tr td {vertical-align: middle;}
-->
</style>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

<?php $this->load->view('admin/adfooter.html'); ?>

<script type="text/javascript">
<!--
var staw = true;
$(":checkbox").on('click',function(e){
	var name = $(this).attr("name");
	var url = $("#switchbox").attr("action");
	$.post(url,{switchname:name},function(data){
		if(data){
			if($("#"+name).text()=="开"){
				$("#"+name).text("关");
			}else{
				$("#"+name).text("开");
			}
		}else{
			alert("您无此权限");
		}
	});
});
//-->
</script>

